class TopLine extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            menuicon: !0,
        };
    }

    componentDidMount() {
        // checklogin(res=>{})
    }
    menuicon() {
        let { menuicon } = this.state
        this.setState({ menuicon: !menuicon })
    }
    quit() {
        $.cookie('token', "");
        window.location.href = './docshopunknwo.html'
    }

    render() {
        let { menuicon } = this.state
        return (
            <div className='topLine'>
                {/* <img className='bwv' src={Constant.LOGO} /> */}
                <div className="title">
                    <img className='' src={`./src/${menuicon ? 'menuleft' : 'menuright'}.png`} onClick={this.menuicon.bind(this)} />
                    后台管理系统
                </div>
                <div className='content'>
                    欢迎使用后台管理！
                    <a className='quita' onClick={this.quit}>退出登录</a>
                </div>

            </div>
        )
    }
}

class LeftMenu extends React.Component {
    constructor(props) {
        super(props);
        console.log(props, 'props');

        this.state = {
            category: this.props.category,
            code: this.props.code,
            class: this.props.class,
        };
    }


    componentDidMount() {

    }
    nav(e) {
        var path = `${e}.html`;
        window.location.href = path;
    }

    render() {
        return (
            <div className='LeftMenu'>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p>首页</p>
                    </div>

                </div>
                <div  className='rows'>
                    <div className={"category " } >
                        <p >售后</p>
                        <img src="./src/leftmenu_down.png" alt="" />
                    </div>
                    <div className="subitems">
                        <div className={"subcategory small"} >
                            <p >开单</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >创建订单</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >配件销售</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >耗材领用</p>
                        </div>
                        <div className={"subcategory small"} >
                            <p >单据管理</p>
                        </div>
                        <div onClick={this.nav.bind(this, 'fixinfo')}  className={"subcategory "+ (`${this.state.code == 'fixinfo' ? 'check' : ''}`)} >
                            <p >工单管理</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >销售单管理</p>
                        </div>

                        <div className={"subcategory small"} >
                            <p >客户</p>
                        </div>
                        <div onClick={this.nav.bind(this, 'car')} className={"subcategory "+ (`${this.state.code == 'car' ? 'check' : ''}`)} >
                            <p >车辆管理</p>
                        </div>
                        <div onClick={this.nav.bind(this, 'driver')} className={"subcategory "+ (`${this.state.code == 'driver' ? 'check' : ''}`)} >
                            <p >车主管理</p>
                        </div>
                        <div onClick={this.nav.bind(this, 'member')} className={"subcategory "+ (`${this.state.code == 'member' ? 'check' : ''}`)}>
                            <p >会员管理</p>
                        </div>
                    </div>
                </div>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >仓库</p>
                        <img src="./src/leftmenu_down.png" alt="" />
                    </div>
                    <div className="subitems">
                        <div className={"subcategory small"} >
                            <p >开单</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >采购开单</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >退货开单</p>
                        </div>
                        <div className={"subcategory small"} >
                            <p >单据</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >采购单管理</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >退货单管理</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >盘点单管理</p>
                        </div>
                        <div className={"subcategory small"} >
                            <p >配件及其他</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >配件管理</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >供应商管理</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >出入库管理</p>
                        </div>
                    </div>
                </div>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >报表</p>
                        <img src="./src/leftmenu_down.png" alt="" />
                    </div>
                    <div className={"subcategory"} >
                        <p >售后业务</p>
                    </div>
                </div>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >财务</p>
                        <img src="./src/leftmenu_down.png" alt="" />
                    </div>
                    <div className="subitems">
                        <div className={"subcategory"} >
                            <p >业务收支</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >收支管理</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >财务月报</p>
                        </div>
                        <div className={"subcategory"} >
                            <p >固定资产</p>
                        </div>
                    </div>
                </div>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >人事</p>
                        <img src="./src/leftmenu_down.png" alt="" />
                    </div>
                    <div className={"subcategory"} >
                        <p >员工管理</p>
                    </div>
                    <div className={"subcategory"} >
                        <p >提成管理</p>
                    </div>
                </div>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >营销</p>
                        <img src="./src/leftmenu_down.png" alt="" />
                    </div>
                    <div className={"subcategory samll"} >
                        <p >优惠券</p>
                    </div>
                    <div className={"subcategory"} >
                        <p >优惠券管理
                        </p>
                    </div>
                    <div className={"subcategory samll"} >
                        <p >套餐卡
                        </p>
                    </div>
                    <div className={"subcategory"} >
                        <p >套餐卡管理 </p>
                    </div>
                    <div className={"subcategory"} >
                        <p>销售记录</p>
                    </div>
                    <div className={"subcategory small"} >
                        <p>工具</p>
                    </div>
                    <div className={"subcategory"} >
                        <p >助力砍价 </p>
                    </div>
                    <div className={"subcategory"} >
                        <p>短信管理</p>
                    </div>
                </div>
                <div className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >提醒</p>
                    </div>
                   
                </div>
                <div  className='rows'>
                    <div className={"category " + (`${this.state.code == 'category' ? 'check' : ''}`)} >
                        <p >设置</p>
                    </div>
                   
                </div>

            </div >



        )
    }
}